#include <stdio.h>

int
main
()
{
	int k;
	int seq, prev = -1, preprev, combo = 1, amount = 0;

	scanf("%d", &k);
	while (scanf("%d", &seq) == 1) {
		preprev = prev;
		if (prev == seq) {
			combo++;
		} else {
			if (combo > k)
				amount++;
			combo = 1;
		}
		prev = seq;
	}
	if ((preprev == prev) && (prev == seq) && (++combo > k))
		amount++;

	printf("%d\n", amount);
	return 0;
}
